import { constantRoutes } from '@/router' // 导入静态路由

export default {
  namespaced: true, // 开启命名空间
  state: () => ({
    // 声明最终路由信息,默认静态路由
    routes: constantRoutes
  }),

  mutations: {
    // 声明修改state的方法
    setRoute(state, asyncRoutes) {
      // 合并动静态路由,并重新赋值
      state.routes = [...constantRoutes, ...asyncRoutes]
    }
  },
  getters: {},
  actions: {}
}
